﻿<%@ Page Title="Home Page" Language="C#" MasterPageFile="~/Site.master" AutoEventWireup="true"
    CodeBehind="Default.aspx.cs" Inherits="HomeFramework._Default" %>

<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
    <div runat="server" id="MessageBox" style="width: 100%; background-color: Red; color: White;">
        <asp:Label runat="server" ID="messageLabel" />
    </div>
    <div style="float: right;">
        <asp:FileUpload runat="server" ID="fileUpload" Visible="false" />
        <asp:LinkButton runat="server" ID="uploadButton" Text="Upload Service" OnClick="uploadButton_Click" />
    </div>
    <h3 style="clear: both;">
        Service List</h3>
    <asp:GridView ID="GridView1" runat="server" DataKeyNames="ID" Width="100%" AutoGenerateColumns="False"
        CellPadding="4" ForeColor="#333333" GridLines="None" RowStyle-Wrap="true" AlternatingRowStyle-Wrap="true"
        OnRowDeleting="GridView1_RowDeleting">
        <AlternatingRowStyle BackColor="White" ForeColor="#284775" />
        <Columns>
            <asp:BoundField DataField="Enabled" HeaderText="Enabled" SortExpression="Enabled" />
            <asp:TemplateField HeaderText="Name" SortExpression="Name">
                <ItemTemplate>
                    <asp:LinkButton ID="LinkButton1" runat="server" Text='<%# Eval("Name") %>' PostBackUrl='<%# "~/Manager/Detail.aspx?ID=" + Eval("ID").ToString() %>' />
                </ItemTemplate>
            </asp:TemplateField>
            <%--<asp:BoundField DataField="Namespace" HeaderText="Namespace" SortExpression="Namespace" />--%>
            <asp:BoundField DataField="Version" HeaderText="Assembly Version" SortExpression="Version" />
            <asp:BoundField DataField="ReferenceCount" HeaderText="# References" SortExpression="ReferenceCount"
                DataFormatString="{0:N0}" />
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:HyperLink ID="HyperLink1" runat="server" Text="SVC" Target="_blank"
                        NavigateUrl='<%# string.Format("{0}?help={1}&version={2}", HomeFramework.Model.Configuration.GetValue(HomeFramework.Model.Configuration.wsdlBasePath), Eval("Name"), Eval("Version")) %>' 
                        Visible='<%# Eval("Enabled") %>'
                        />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:HyperLink ID="HyperLink2" runat="server" Text="WSDL" Target="_blank"
                        NavigateUrl='<%# string.Format("{0}?wsdl={1}&version={2}", HomeFramework.Model.Configuration.GetValue(HomeFramework.Model.Configuration.wsdlBasePath), Eval("Name"), Eval("Version")) %>' 
                        Visible='<%# Eval("Enabled") %>'
                        />
                </ItemTemplate>
            </asp:TemplateField>
            <asp:TemplateField>
                <ItemTemplate>
                    <asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="~/Styles/x.png" OnClientClick="return confirm('Confirm delation?')"
                        CommandName="Delete" />
                </ItemTemplate>
            </asp:TemplateField>
        </Columns>
        <EditRowStyle BackColor="#999999" />
        <FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
        <PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
        <RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
        <SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
        <SortedAscendingCellStyle BackColor="#E9E7E2" />
        <SortedAscendingHeaderStyle BackColor="#506C8C" />
        <SortedDescendingCellStyle BackColor="#FFFDF8" />
        <SortedDescendingHeaderStyle BackColor="#6F8DAE" />
        <EmptyDataTemplate>
            <h4>
                No data found</h4>
        </EmptyDataTemplate>
    </asp:GridView>
</asp:Content>
